<template>
	<view class="container">
		<view class="list-cell b-b m-t" @click="navTo('/pages/mine/personal/geren')" hover-class="cell-hover" :hover-stay-time="50">
			<text class="cell-tit">个人资料</text>
			<text class="cell-more yticon icon-you"></text>
		</view>

		<view class="list-cell" @click="navTo('/pages/mine/personal/renzheng')" hover-class="cell-hover" :hover-stay-time="50">
			<text class="cell-tit">实名认证</text>
			<text class="cell-more yticon icon-you"></text>
		</view>

		<view class="list-cell m-t b-b" @click="navTo('清除缓存')" hover-class="cell-hover" :hover-stay-time="50">
			<text class="cell-tit">清除缓存</text>
			<text class="cell-more yticon icon-you"></text>
		</view>
		<view class="list-cell b-b" @click="navTo('关于Dcloud')" hover-class="cell-hover" :hover-stay-time="50">
			<text class="cell-tit">关于我们</text>
			<text class="cell-more yticon icon-you"></text>
		</view>
		<view class="list-cell">
			<text class="cell-tit">检查更新</text>
			<text class="cell-tip">当前版本 1.0.0</text>
			<text class="cell-more yticon icon-you"></text>
		</view>
		<view class="list-cell log-out-btn" @click="toLogout" style="display: flex; justify-content: center;">
			<text class="cell-tit">退出登录</text>
		</view>
	</view>
</template>

<script>
	import {
		apiUrl
	} from '@/config/config.js';

	export default {
		data() {
			return {
				apiUrl: apiUrl,
			};
		},

		methods: {
			navTo(url) {
				uni.navigateTo({
					url: url
				})
			},
			//退出登录
			toLogout() {
				console.log(uni.getStorageSync('account_key'))
				uni.showModal({
					title: '友情提示',
					content: '您确定要退出登录吗?',
					success(res) {
						if (res.confirm) {
							try {
								uni.removeStorageSync('islogin_key');
								uni.removeStorageSync("account_key")
							} catch (e) {
								// error
							}
							console.log(uni.getStorageSync('account_key'))
							this.isLogin = false
							uni.reLaunch({
								url: '/pages/mine/index' // 将'/pages/currentPage/currentPage'替换为当前页面的路径
							});
						}
					}
				})
			},
		}
	}
</script>

<style lang='scss'>
	.list-cell {
		display: flex;
		align-items: baseline;
		padding: 20upx;
		line-height: 60upx;
		position: relative;
		background: #fff;
		justify-content: center;

	}

	.log-out-btn {
		margin-top: 40upx;
	}
	.log-out-btn .cell-tit {
		flex: 1;
		font-size: 30rpx;
		text-align: center;
		color: #fa2209;
		margin-right: 10upx;
	}

	.cell-hover {
		background: #fafafa;
	}

	.b-b:after {
		left: 30upx;
	}

	.m-t {
		margin-top: 16upx;
	}

	.cell-more {
		align-self: baseline;
		font-size: 18upx;
		color: #000;
		margin-left: 10upx;
	}

	.cell-tit {
		flex: 1;
		font-size: 30rpx;
		color: #000;
		margin-right: 10upx;
	}

	.cell-tip {
		font-size: 30rpx;
		color: #000;
	}

	switch {
		transform: translateX(16upx) scale(.84);
	}
</style>